Reading the datasets
library(gapminder)
library(gganimate)
library(gifski)
# load datasets
setwd("C:/Users/sagar/OneDrive/Desktop/sta553/Dataset")
income_per_person <- read.csv("income_per_person.csv")
life_expectancy <- read.csv("life_expectancy_years.csv")
country_region <- read.csv("countries_total.csv")
population <- read.csv("population_total.csv")
Reshape data set: Income Per Person to make a longitudinal data such that the resulting data set has three columns: country, year, and income.
Do the same for Life Expectancy in Years so that the resulting data set has three columns: country, year, and life expectancy.
Merge/join the above two longitudinal data sets to make a new data set, under name LifeExpIncom that has variables: country, year, lifeExp, and income.
Merge LifeExpIncom with country region so that the final data set has information about income, life expectancy, and country region.
Make an interactive scatter plot to display the association between life expectancy and income for the year 2015.
Make an animated scatter plot that shows pattern of change in the relationship between life expectancy and income over the years. [required]
##Choose an appropriate R map library to create an interactive map of the gas station data and show some information of each gas station on the map.